function B=trimpolmat(A,tol);

[n m]=size(A);

for i=1:n
    for j=1:m
        
        B{i,j}=trimpol(A{i,j},tol);
        
    end
end